IF OBJECT_ID('dbo.RptAgrDemographicValidataionSummary') IS NOT NULL
BEGIN
    DROP PROCEDURE dbo.RptAgrDemographicValidataionSummary
    IF OBJECT_ID('dbo.RptAgrDemographicValidataionSummary') IS NOT NULL
        PRINT '<<< FAILED DROPPING PROCEDURE dbo.RptAgrDemographicValidataionSummary >>>'
    ELSE
        PRINT '<<< DROPPED PROCEDURE dbo.RptAgrDemographicValidataionSummary >>>'
END
go
-- =======================================================================
-- Procedure Name: dbo.RptAgrDemographicValidataionSummary
--
-- Author:      Chris Bernard, Parallax Consulting LLC
--
-- Create date: 8/09/2007
--
-- Description: Source of Report, "RptAgrDemographicValidataionSummary"
--                  In Insight DB Reporting Services
--
-- Parameters:  
-- 
--              
-- Returns:     INT, 0=Success, -1=Error
--
-- SampleCall:
-- EXECUTE dbo.RptAgrDemographicValidataionSummary()
--
--------------------------------------------------------------------------
-- Date        Initials  Modification
--------------------------------------------------------------------------
-- 8/09/07     CB        Created
-- =======================================================================

CREATE PROCEDURE dbo.RptAgrDemographicValidataionSummary(@LogDate DATETIME)
AS
BEGIN
    -- Initial Settings
	SET NOCOUNT ON
     
    -- Declare Local Variables
    DECLARE   @Error INT,
              @RowCount INT
             
   
    SELECT LogDate,TotalFileRecCnt,
           MGHActiveCnt,MGHInactiveCnt,
           BWHActiveCnt,BWHInactiveCnt,
           OtherActiveCnt,OtherInactiveCnt,
           ActivPSGrantNumberMatchCnt,
           InactivePSGrantNumberMatchCnt
      FROM dbo.Stg_AgrDemographicValidataionLog D
     WHERE LogDate =@LogDate

    SELECT @Error=@@ERROR,@RowCount=@@ROWCOUNT
    IF @Error!=0
         RETURN -1
         
    -- Return Success
    RETURN 0
     
END
go

IF OBJECT_ID('dbo.RptAgrDemographicValidataionSummary') IS NOT NULL
    PRINT '<<< CREATED PROCEDURE dbo.RptAgrDemographicValidataionSummary >>>'
ELSE
    PRINT '<<< FAILED CREATING PROCEDURE dbo.RptAgrDemographicValidataionSummary >>>'
go

GRANT EXECUTE ON dbo.RptAgrDemographicValidataionSummary TO InsightReport,Insight
go


